package jtk.project4.fleet.ibatis.dao;

import java.util.List;
import java.sql.SQLException;
import jtk.project4.fleet.domain.SecForms;

public class SecformsDao extends IbatisDao{
	/*	
	public List selectSecformsFormID() throws SQLException {
		List selectSecformsFormID = null;
		selectSecformsFormID =getSqlMap().queryForList("select_all_secforms", null);
		return selectSecformsFormID;
	}  */
	 
	public int deleteSecforms(SecForms secform) throws SQLException{
		return (int) getSqlMap().delete("delete_secforms", secform);
	}
	
	public int updateSecforms(SecForms secform) throws SQLException{
		return (int) getSqlMap().update("update_secforms", secform);
	}
	 
	public SecForms insertSecforms(SecForms secforms) throws SQLException{
		return (SecForms) getSqlMap().insert("insert_secforms", secforms);
	}

	public List selectAllSecforms() throws SQLException {
		return getSqlMap().queryForList("select_all_secforms", null);
	}
	
	public SecForms selectSecforms(int id) throws SQLException {
		return (SecForms) getSqlMap().queryForObject("select_secforms", id);
	}
	
	public static void main (String args[]) throws SQLException{
		SecForms secform = new SecForms();
		List<SecForms> secforms;
		
		//secform.setName("Jatibarang");
		//secform.setCaption("Jadul");
		//new SecformsDao().insertSecforms(secform);
		//secform = new SecformsDao().selectSecforms(14);
		//secform.setName("Jatiwaringin");
		//secform.setCaption("Hajar Saja Dia");
		//new SecformsDao().updateSecforms(secform);
		//System.out.println(secforms.size());
		secform.setFormId(15);
		new SecformsDao().deleteSecforms(secform);
	}	
}